package com.itheima.homew;

import java.net.Proxy;

/*

【编号：702】

请定义教师类（Teacher），属性包括姓名和工号。要求分别使用空参和有参构造方法创建对象，
空参创建的对象通过setXxx赋值，有参创建的对象直接赋值。定义教课（teach）方法，输出“工号为xxx的xxx老师正在讲课”。 */
class Teachermsg{
    private String name ;
    private int count;

    public Teachermsg() {
    }

    public Teachermsg(String name, int count) {
        this.name = name;
        this.count = count;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public int getCount() {
        return count;
    }

    public void setCount(int count) {
        this.count = count;
    }
    public void teach(){
        System.out.println("工号为"+count+"的"+name+"老师正在讲课");
    }
}
public class Teacher {
    public static void main(String[] args) {
        Teachermsg t1 = new Teachermsg("陈辉",007);
        t1.teach();
        Teachermsg t2 = new Teachermsg();
        t2.setName("黄桂林");
        t2.setCount(996);
        t2.teach();
    }

}
